package com.sc.byahi.user.client;

import java.util.List;
import java.util.Map;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.sc.byahi.user.shared.InitDataVO;
import com.sc.byahi.user.shared.Notice;
import com.sc.byahi.user.shared.Profile;
import com.sc.byahi.user.shared.ProfileOwner;
import com.sc.byahi.user.shared.ProfileVO;
import com.sc.byahi.user.shared.SearchBean;
import com.sc.byahi.user.shared.SuccessStory;
import com.sc.byahi.user.shared.constants.Lists;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static GreetingServiceAsync instance;
		public static GreetingServiceAsync getInstance(){
			if (instance == null) {
				instance = GWT.create(GreetingService.class);
			}
			return instance;
		}
	}

	// Admin functions
	Boolean deleteProfileOwner(String gmailId);
	Boolean deleteProfile(Long id);

	List<Long> findAdminUnapprovedProfiles(); 
	String getUploadURL();
	Boolean approveProfile(Long profileId);
	Boolean clearMemcache();
	String getMemcache();
	Boolean toggleMemcache();
	Boolean disapproveProfile(Long profileId);
	String createTestProfiles(String gender, String data);
	Map<Long, String> getUnsentEmails() ;
	Boolean approveEmail(Long metadataId) ;
	void publishNotice(Notice notice) ;
	void deleteNotice() ;


	// User's own functions
	InitDataVO getInitData();
	Map<Lists, Map<String, List<String>>> getLists();
	Map<Long, Map<Long, String>> findMyInterestData();
	ProfileOwner updateProfileOwner(ProfileOwner owner);
	Long createProfile(Profile profile);
	void updateProfile(Profile profile);
	List<Long> findMyProfileIds(Boolean approved);
	List<Profile> findMyProfilesById(List<Long> ids);
	Map<Long, String> findMyProfilesNamesByIds();
	/**
	 * Only individual users can show interest, agents are not allowed, as they can not show interest on other's behalf.
	 * @param targetProfileId
	 * @return
	 */
	Boolean interestShow(Long myProfileId, Long targetProfileId);
	Boolean interestAccept(Long myProfileId, Long targetProfileId);
	Boolean interestHold(Long myProfileId, Long senderProfileId);
	Boolean rateProfile(Long targetProfileId, Long rating);
	Boolean sendMessage(Long from, Long to, String body);
	SearchBean findSearchCriteria(String name);
	List<String> findSearchCriteriaNames();
	Boolean saveSearchCriteria(SearchBean sb);
	void deleteSearchCriteria(String name);
	/**
	 * returns ratings for ths profile
	 * @param currentProfileId
	 * @return
	 */
	Map<Long, Long> setCurrentProfileId(Long currentProfileId);
	
	
	// Public functions
	List<Profile> findPublicProfilesByIds(List<Long> ids);
	List<ProfileVO> findPublicProfilesMapDetailsByIds(List<Long> ids);
	List<Long> findPublicProfileIdsByAgency(Long sampleId);
	List<Long> findPublicProfileIds(SearchBean sb);
	String getPublicUploadURL();
	List<Long> verifyProfileIds(List<Long> ids);

	void createSuccessStory(SuccessStory story);
	List<Long> getAllSuccessStories();
	List<SuccessStory> getSuccessStories(List<Long> ids);
	Boolean approveSuccessStory(Long id);
	Boolean deleteSuccessStory(Long id);
	boolean toggleTestUpload();

}
